From: Jasper St. Pierre Date: Mon, 15 Jul 2013 23:46:25 +0000 (-0400) Subject: panelMenu: Show/hide the indicators box based on indicator visibility X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3767 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4ba6791043c36b17afa9007d3784d0ad1492eee3;p=gnome-shell.git panelMenu: Show/hide the indicators box based on indicator visibility This ensures that there's no empty space in the indicators box, and we don't have to manage it manually. https://bugzilla.gnome.org/show_bug.cgi?id=705845 --- diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js index f6c48a450..8bad21d75 100644 --- a/js/ui/panelMenu.js +++ b/js/ui/panelMenu.js @@ -241,13 +241,22 @@ const SystemIndicator = new Lang.Class({ _init: function() { this.indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box', reactive: true }); + this.indicators.hide(); this.menu = new PopupMenu.PopupMenuSection(); }, + _syncIndicatorsVisible: function() { + this.indicators.visible = this.indicators.get_children().some(function(actor) { + return actor.visible; + }); + }, + addIndicator: function(gicon) { let icon = new St.Icon({ gicon: gicon, style_class: 'system-status-icon' }); this.indicators.add_actor(icon); + icon.connect('notify::visible', Lang.bind(this, this._syncIndicatorsVisible)); + this._syncIndicatorsVisible(); return icon; } });